package STUDENT.TRANDAODAIVI.ARRAY;

class Calculate{
	
	public static int average(int[] array){
		int sum=0;
		for (int i=0;i<array.length;i++){
			sum=sum+array[i];
		}
		return sum/array.length;
	};
	public static double average(double[] array){
		double sum=0;
		for (int i=0;i<array.length;i++){
			sum=sum+array[i];
		}
		return (sum/array.length);
	};
	
}
public class BT2 {
public static void main(String[] args) {
	int array1[]={1,2,3,4,5,6};
	double array2[]={6.0,4.4,1.9,2.9,3.4,3.5};

	System.out.println(" "+Calculate.average(array2));
	System.out.println(" "+Calculate.average(array1));
}
}
